# 生成创建500张表的SQL语句
table_prefix = "table_"
columns = "id INT AUTO_INCREMENT PRIMARY KEY, data VARCHAR(255)"

# 打开一个文件以写入SQL语句
with open("create_tables.sql", "w") as file:
    for i in range(1, 501):
        table_name = f"{table_prefix}{i}"
        create_table_sql = f"CREATE TABLE IF NOT EXISTS {table_name} ({columns});\n"
        file.write(create_table_sql)

print("SQL statements have been written to 'create_tables.sql'")